import {createAction, createThunkAction} from "../../lib/redux-utils";
import {get, postJson} from "../../lib/http";

export const showCreate = createAction("NOTES.SHOW_CREATE");
export const hideCreate = createAction("NOTES.HIDE_CREATE");
export const showModify = createAction("NOTES.SHOW_MODIFY");
export const hideModify = createAction("NOTES.HIDE_MODIFY");
export const updateModel = createAction("NOTES.UPDATE");

export const query = createThunkAction("NOTES.QUERY", params =>
    postJson("/notes/query", params)
);
export const create = createThunkAction("NOTES.CREATE", params =>
    postJson("/notes/create", params)
);
export const del = createThunkAction("", params =>
    get("/notes/delete/" + params)
);

